Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model: support database placement option and partition placement option #1342

Merged

Conversation

zhaoxugang
Copy link
Contributor

@zhaoxugang zhaoxugang commented Sep 14, 2021

What problem does this PR solve?

support database placement option and partition placement option

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 14, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AilinKid
  • xhebox

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@zhaoxugang
Copy link
Contributor Author

/cc @AilinKid @xhebox

Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overlap with #1340, looks like. Maybe you need to discuss with @mjonss .

model/ddl.go Outdated
@@ -84,6 +84,7 @@ const (
ActionCreatePlacementPolicy ActionType = 51
ActionAlterPlacementPolicy ActionType = 52
ActionDropPlacementPolicy ActionType = 53
ActionAlterTablePartitionOptions ActionType = 54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a smaller name. We will transform ast.TableOption into different actions, refer https://github.com/pingcap/tidb/blob/257140a154a13061b55993f499aa25f0cd07cdf6/ddl/ddl_api.go#L2530-L2573. We don't really have AlterTableOption type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a smaller name. We will transform ast.TableOption into different actions, refer https://github.com/pingcap/tidb/blob/257140a154a13061b55993f499aa25f0cd07cdf6/ddl/ddl_api.go#L2530-L2573. We don't really have AlterTableOption type.

the constant is used for ddl.runDDLJob() to mark job type not ddl.AlterTable()

Copy link
Contributor

@xhebox xhebox Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is what I mean. If we are going to support partition option, it is likely we don't have AlterTablePartition action. Instead, we may have AlterTablePolicy or RebaseTable.

It is kind of hard to support all table options in one ddl job. We usually process the option one by one with different jobs.

@mjonss
Copy link
Contributor

mjonss commented Sep 14, 2021

I just merged #1340 so the model now has both PlacementPolicyRef and DirectPlacementOpts on both DBInfo and PartitionDefinition.

@zhaoxugang
Copy link
Contributor Author

/cc @AilinKid

@zhaoxugang zhaoxugang closed this Sep 17, 2021
@zhaoxugang zhaoxugang force-pushed the support_database_placement_option_ branch from 4b866ff to b06127c Compare September 17, 2021 13:42
@zhaoxugang zhaoxugang reopened this Sep 17, 2021
@ti-chi-bot ti-chi-bot added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Sep 22, 2021
@AilinKid AilinKid merged commit be47489 into pingcap:master Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants